using System;
using System.Xml.Serialization;

namespace com.exceptionalsoftware.spacetime.KML
{
	[Serializable()]
    [XmlType(TypeName = "PlacemarkType")]
    public class Placemark : Feature
	{
        private Geometry geometryInstance;

        public Placemark()
		{
            // Do nothing.
		}

        public Placemark(Geometry g)
        {
            this.Geometry = g;
        }

        public Placemark(string name)
        {
            this.Name = name;
        }

        public Placemark(string name, string id)
        {
            this.Id = id;
            this.Name = name;
        }

        public Placemark(string name, Geometry g)
        {
            this.Name = name;
            this.Geometry = g;
        }

        public Placemark(string name, string id, Geometry g)
        {
            this.Id = id;
            this.Name = name;
            this.Geometry = g;
        }

        [XmlElement(ElementName = "LineString", Type = typeof(LineString))]
        [XmlElement(ElementName = "LinearRing", Type = typeof(LinearRing))]
        [XmlElement(ElementName = "Model", Type = typeof(Model))]
        [XmlElement(ElementName = "MultiGeometry", Type = typeof(MultiGeometry))]
        [XmlElement(ElementName = "Point", Type = typeof(Point))]
        [XmlElement(ElementName = "Polygon", Type = typeof(Polygon))]
        public Geometry Geometry
        {
            get { return this.geometryInstance; }
            set { this.geometryInstance = value; }
        }
    }
}